package com.bjsubway.gov.info.manager.controller;

import com.bjsubway.gov.info.manager.service.SubwayService;

import java.util.Scanner;

public class SubwayController {
    Scanner sc = new Scanner(System.in);
    SubwayService ss = new SubwayService();

    public void start() {
        while (true) {
            System.out.println("请输入您要进行的操作:1.查看地铁站 2.添加地铁站");
            String choice = sc.next();
            switch (choice){
                case "1":
                    check();
                    System.exit(0);
                case "2":
                    add();
                    System.exit(0);
                default:
                    break;
            }
        }
    }
    //地铁站编号，地铁站名称，所属路线
    public void add() {
        System.out.println("请输入地铁站编号:");
        String num = sc.next();
        System.out.println("请输入地铁站名称");
        String name = sc.next();
        System.out.println("请输入地铁站所属路线");
        String line = sc.next();
        ss.add(num, name, line);
        System.out.println("添加成功");
    }

    public void check() {

        ss.check();
    }
}
